/**
 * @author
 * Júlio Zynger
 * DRE: 110092466
 */
package view;

import java.awt.BorderLayout;
import java.awt.EventQueue;
import java.awt.Font;
import java.awt.Frame;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
import javax.swing.border.EmptyBorder;

@SuppressWarnings("serial")
public class Inicio extends JFrame {

	private JPanel contentPane;
	public static Inicio frame;
	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					frame = new Inicio();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public Inicio() {
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setResizable(false);
		setBounds(400, 300, 350, 310);
		setTitle("Autômatos Finitos Determinísticos");
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		contentPane.setLayout(new BorderLayout(0, 0));
		setContentPane(contentPane);
		
		JLabel label = new JLabel(new ImageIcon("src\\imagetop.png"));
		contentPane.add(label, BorderLayout.NORTH);
		
		JPanel panel = new JPanel();
		panel.setLayout(new GridLayout(5, 1));
		contentPane.add(panel, BorderLayout.CENTER);
		
		JButton btnAceitar = new JButton("Aceitação de Palavra");
		panel.add(btnAceitar);
		
		JButton btnBrzo = new JButton("Alg. de Brzozowski");
		panel.add(btnBrzo);
		
		JButton btnKleene = new JButton("Alg. de Kleene");
		panel.add(btnKleene);
		
		JLabel lblAutor = new JLabel("Júlio Zynger");
		lblAutor.setVerticalAlignment(SwingConstants.BOTTOM);
		lblAutor.setFont(new Font("Times New Roman", Font.BOLD, 16));
		lblAutor.setHorizontalAlignment(SwingConstants.CENTER);
		panel.add(lblAutor);
		
		JLabel lblDre = new JLabel("110092466");
		lblDre.setVerticalAlignment(SwingConstants.TOP);
		lblDre.setHorizontalAlignment(SwingConstants.CENTER);
		lblDre.setFont(new Font("Times New Roman", Font.ITALIC, 14));
		panel.add(lblDre);
		
		btnAceitar.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e1) {
				Inicio.this.setState(Frame.ICONIFIED); //minimizar jframe
				//Inicio.this.setState(Frame.NORMAL); restaurar a janela
				DadosAutomato ap = new DadosAutomato(0);
				ap.setVisible(true);
				
			}
		});
		
		btnBrzo.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e1) {
				Inicio.this.setState(Frame.ICONIFIED); //minimizar jframe
				//Inicio.this.setState(Frame.NORMAL); restaurar a janela
				DadosAutomato ap = new DadosAutomato(1);
				ap.setVisible(true);
				
			}
		});
		
		btnKleene.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e1) {
				Inicio.this.setState(Frame.ICONIFIED); //minimizar jframe
				//Inicio.this.setState(Frame.NORMAL); restaurar a janela
				DadosAutomato ap = new DadosAutomato(2);
				ap.setVisible(true);
				
			}
		});
	}

}
